@extends('layouts.master')
@section('title')
    会员信息
@endsection
@section('content')
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form class="layui-form" action="">
                        <div class="layui-inline">
                            <label class="layui-form-label">id:</label>
                            <div class="layui-input-inline">
                                <input type="text" name="id"  placeholder="请输入id" class="layui-input" value="{{\Request::input('id')}}">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">昵称:</label>
                            <div class="layui-input-inline">
                                <input type="text" name="nickname"  placeholder="请输入昵称" class="layui-input" value="{{\Request::input('nickname')}}">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">手机号:</label>
                            <div class="layui-input-inline">
                                <input type="text" name="phone"  placeholder="请输入手机" class="layui-input" value="{{\Request::input('phone')}}">
                            </div>
                        </div>
                        <div class="layui-inline" style="padding-bottom: 5px">
                            <div class="layui-input-inline">
                                <button class="btn btn-success" type="submit">搜索</button>
                            </div>
                        </div>
                    </form>

                    @section('toolbar')
                        <span class="left">

                        </span>
                    @endsection
                    @include('common.toolbar', ['pager' => $users])
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>会员信息</th>
                            <th>身份</th>
                            <th>余额</th>
                            <th>成交</th>
                            <th>注册时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($users as $item)
                            <tr>
                                <th>{{$item->id}}</th>
                                <td>
                                    <img src="{{$item->avatar}}"
                                         class="rounded-circle img-sm img_pop_show"/><br/>
                                    昵称：{{$item->nickname}}<br>
                                    手机号：{{$item->mobile}}
                                </td>
                                <td>
                                    @if($item->is_leader)
                                        镖头
                                    @elseif($item->escort)
                                        镖师
                                    @else
                                        普通会员
                                    @endif
                                </td>
                                <th>
                                    余额: <span class="text-danger">{{$item->balance}}</span>
                                </th>
                                <th>
                                    订单: <span class="text-success">{{$item->pay}}</span><br/>
                                    金额: <span class="text-danger">{{$item->count}}</span>
                                </th>
                                <th>
                                    {{$item->created_at}}
                                </th>
                                <th>
                                    <div class="dropdown btn btn-info" >
                                        <div data-toggle="dropdown" class="dropdown-toggle" href="#">
                                            操作
                                        </div>
                                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                            @if($item->is_leader == 0)
                                                <li>
                                                    <a class="btn btn-outline btn-success ajax-confirm" data-method="post" data-url="{{route('user.be_leader',['id'=>$item->id])}}" data-title="确定吗？" href="javascript:;">成为镖头</a>
                                                </li>
                                            @elseif($item->is_leader == 1)
                                                <li>
                                                    <a class="btn btn-outline btn-danger ajax-confirm" data-method="post" data-url="{{route('user.cancel_leader',['id'=>$item->id])}}" data-title="确定吗？" href="javascript:;">取消镖头</a>
                                                </li>
                                            @endif
                                        </ul>
                                    </div>
                                </th>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @include('common.pagination', ['pager' => $users])
                </div>
            </div>
        </div>
    </div>
@endsection